<?php

namespace BaseBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints\DateTime;

/**
 * Goods
 *
 * @ORM\Table(name="goods", options={"comment":"商品表"})
 * @ORM\Entity()
 */
class Goods
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var GoodsClassify
     *
     * @ORM\ManyToOne(targetEntity="BaseBundle\Entity\GoodsClassify", inversedBy="id")
     * @ORM\JoinColumn(name="goods_classify_id", referencedColumnName="id")
     */
    private $goodsClassify;

    /**
     * @var string
     *
     * @ORM\Column(name="goods_no", type="string", length=45, options={"comment":"商品编号"})
     */
    private $goodsNo;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=45, options={"comment":"名称"})
     */
    private $name;


    /**
     * @var string
     *
     * @ORM\Column(name="thumb", type="string", length=255, options={"comment":"缩略图"})
     */
    private $thumb;

    /**
     * @var string
     *
     * @ORM\Column(name="exhibition_img", type="simple_array", options={"comment":"展示图"})
     */
    private $exhibitionImg;

    /**
     * @var string
     *
     * @ORM\Column(name="introduction", type="string", length=255, nullable=true,  options={"comment":"简介"})
     */
    private $introduction;

    /**
     * @var string
     *
     * @ORM\Column(name="content", type="text", nullable=true, options={"comment":"内容"})
     */
    private $content;

    /**
     * @var int
     *
     * @ORM\Column(name="stock", type="integer", nullable=true, options={"comment"="库存 -1代表无限制", "default"=-1})
     */
    private $stock;

    /**
     * @var int
     *
     * @ORM\Column(name="sales_volume", type="integer", nullable=true, options={"comment"="销量", "default"=0})
     */
    private $sales_volume;

    /**
     * @var int
     *
     * @ORM\Column(name="pay_number", type="integer", nullable=true, options={"comment"="购买人数", "default"=0})
     */
    private $pay_number;

    /**
     * @var string
     *
     * @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=2, options={"comment"="进货价", "default"="0.00"})
     */
    private $purchase_price;

    /**
     * @var string
     *
     * @ORM\Column(name="distribution", type="decimal", precision=10, scale=2, options={"comment"="分销奖励", "default"="0.00"})
     */
    private $distribution;
    
    /**
     * @var string
     *
     * @ORM\Column(name="postage", type="decimal", precision=10, scale=2, options={"comment"="邮费 0.00代表免邮费", "default"="0.00"})
     */
    private $postage;

    /**
     * @var string
     *
     * @ORM\Column(name="market_price", type="decimal", precision=10, scale=2,  nullable=true, options={"comment"="原价"})
     */
    private $marketPrice;

    /**
     * @var string
     *
     * @ORM\Column(name="current_price", type="decimal", precision=10, scale=2, options={"comment"="优惠价", "default"="0.00"})
     */
    private $currentPrice;

    /**
     * @var string
     *
     * @ORM\Column(name="discount", type="string", nullable=true, options={"comment"="折扣率（前台直接显示）优惠价/原价", "default"=0})
     */
    private $discount;

    /**
     * @var boolean
     *
     * @ORM\Column(name="status", type="boolean", nullable=true, options={"default":1, "comment":"状态位: 0禁用 1正常"})
     */
    private $status;

    /**
     * @var int
     *
     * @ORM\Column(name="sort_order", type="integer", nullable=true, options={"comment"="排序的序号", "default"=0})
     */
    private $sortOrder;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_at", type="datetime", options={"comment":"创建时间"})
     */
    private $createdAt;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"更新时间"})
     */
    private $updatedAt;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="newest_deal_at", type="datetime", nullable=true, options={"comment":"最新成交时间"})
     */
    private $newestDealAt;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_index", type="boolean", nullable=true, options={"comment":"是否是否推荐", "default"=0})
     */
    private $is_index;
    
    /**
     * @var DateTime
     *
     * @ORM\Column(name="start_time", type="datetime", nullable=true, options={"comment":"秒杀开始时间"})
     */
    private $start_time;

    /**
     * @var DateTime
     *
     * @ORM\Column(name="end_time", type="datetime", nullable=true, options={"comment":"秒杀结束时间"})
     */
    private $end_time;

    /**
     * @var int
     *
     * @ORM\Column(name="astrict_num", type="integer", nullable=true, options={"comment"="限制购买数量(秒杀有效)", "default"=0})
     */
    private $astrict_num;

}
